#ifndef	MENU_BTN_H
#define MENU_BTN_H

#include <QAbstractButton>
#include <QStyleOptionButton>

/**
 * A button that can display text, either normally horizontally, or flipped vertically
 */
class CSuperMenuBtn : public QAbstractButton
{
    Q_OBJECT

public:    
    /**
     * Display the button with the given initial settings
     */
    CSuperMenuBtn (QWidget *parent = NULL);
    CSuperMenuBtn (const QString &text , Qt::Orientation orientation = Qt::Horizontal, QWidget *parent = NULL);

public:
    /** Change text orientation */
    void setOrientation (Qt::Orientation orientation);

    /** Set the action to trigger when this button is selected */
    void setAction (QAction *action);

    /** Calculate size */
    QSize sizeHint () const;
    QSize minimumSizeHint () const;

protected:
    void initStyleOption (QStyleOptionButton *option) const;

    /** Repaint */
    void paintEvent (QPaintEvent *e);

protected slots:    
    /** Selected */
    void thisClicked ();

private:
    /** Current orientation */
    Qt::Orientation iOrientation;

    /** Current action */
    QAction *iAction;

};

#endif	//MENU_BTN_H